package com.casems.controller;


import com.casems.commons.vo.ResultVO;
import com.casems.commons.vo.RoleVO;
import com.casems.service.RolePermissionService;
import com.casems.service.RoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author tch
 * @since 2023-05-18
 */
@RestController
@RequestMapping("/role")
public class RoleController {

    @Autowired
    private RoleService roleService;

    @Autowired
    private RolePermissionService rolePermissionService;

    @GetMapping("/getAll")
    public ResultVO getAll() {
        List<RoleVO> all = roleService.getAll();
        return all!=null && all.size()!=0 ? ResultVO.success(all) : ResultVO.failed();
    }
}

